<include file="Public:header" /><!-- header -->

<div class="wrap">
<div id="icon-{$ur_here.action}" class="icon32 icon32-posts-post"><br /></div><h2>{$ur_here.text}</h2>
<form name="post" action="{:U('Admin/Posts/add')}" method="post" id="post" enctype="multipart/form-data">
<input type="hidden" id="hiddenaction" name="action" value="addpost" />
<input type="hidden" id="post_authorId" name="post_authorId" value="{$users.userid}" />
<input type="hidden" id="post_type" name="post_type" value="post" />
<div id="poststuff" class="metabox-holder has-right-sidebar">
<div id="side-info-column" class="inner-sidebar">

<div id="side-sortables" class="meta-box-sortables"><div id="submitdiv" class="postbox " >
<div class="handlediv"><br /></div><h3 class='hndle'><span>发布</span></h3>
<div class="inside">
<div class="submitbox" id="submitpost">

<div id="minor-publishing">

<div id="minor-publishing-actions">
<div id="save-action">
<input type="submit" name="save" id="save-post" value="保存草稿" tabindex="4" class="button button-highlighted" />
<img src="__PUBLIC__/admin/images/wpspin_light.gif" class="ajax-loading" id="draft-ajax-loading" alt="" />
</div>
<div id="preview-action">
<a class="preview button" href="###" target="wp-preview" id="post-preview" tabindex="4">预览</a>
<input type="hidden" name="wp-preview" id="wp-preview" value="" />
</div>
<div class="clear"></div>
</div>

<div id="misc-publishing-actions">
<div class="misc-pub-section " id="visibility">
<div style="display:block;" id="post-visibility-select" class="hide-if-js">
<span style="display:block;" id="password-span"><label for="post_password">密码：</label> 
<input type="text" name="post_password" id="post_password" value="" /><br />
访问者需要输入密码才能阅读到日志的内容
</span>
</div>
</div>
<div class="misc-pub-section curtime misc-pub-section-last">
	<label for="post_timestamp">日期：</label> 
	<div style="display:block;" id="timestampdiv" class="hide-if-js"><div class="timestamp-wrap">
	<input type="text" id="aa" name="aa" value="2012" size="4" maxlength="4" tabindex="4" autocomplete="off" />年
	<select id="mm" name="mm" tabindex="4">
			<option value="01">一</option>
			<option value="02">二</option>
			<option value="03">三</option>
			<option value="04" selected="selected">四</option>
			<option value="05">五</option>
			<option value="06">六</option>
			<option value="07">七</option>
			<option value="08">八</option>
			<option value="09">九</option>
			<option value="10">十</option>
			<option value="11">十一</option>
			<option value="12">十二</option>
</select>月<input type="text" id="jj" name="jj" value="16" size="2" maxlength="2" tabindex="4" autocomplete="off" />日 <input type="text" id="hh" name="hh" value="03" size="2" maxlength="2" tabindex="4" autocomplete="off" /> : <input type="text" id="mn" name="mn" value="05" size="2" maxlength="2" tabindex="4" autocomplete="off" /></div><input type="hidden" id="ss" name="ss" value="37" />
请选择一个发布日期
<input type="hidden" id="hidden_mm" name="hidden_mm" value="04" />
<input type="hidden" id="cur_mm" name="cur_mm" value="04" />
<input type="hidden" id="hidden_jj" name="hidden_jj" value="16" />
<input type="hidden" id="cur_jj" name="cur_jj" value="16" />
<input type="hidden" id="hidden_aa" name="hidden_aa" value="2012" />
<input type="hidden" id="cur_aa" name="cur_aa" value="2012" />
<input type="hidden" id="hidden_hh" name="hidden_hh" value="03" />
<input type="hidden" id="cur_hh" name="cur_hh" value="03" />
<input type="hidden" id="hidden_mn" name="hidden_mn" value="05" />
<input type="hidden" id="cur_mn" name="cur_mn" value="05" />
</div>
</div>
</div>
<div class="clear"></div>
</div>

<div id="major-publishing-actions">
<div id="delete-action">
<a class="submitdelete deletion" href="###">移至回收站</a></div>

<div id="publishing-action">
<img src="__PUBLIC__/admin/images/wpspin_light.gif" class="ajax-loading" id="ajax-loading" alt="" />
		<input name="original_publish" type="hidden" id="original_publish" value="发布" />
		<input type="submit" name="publish" id="publish" class="button-primary" value="发布" tabindex="5" accesskey="p"  /></div>
<div class="clear"></div>
</div>
</div>

</div>
</div>

<div id="categorydiv" class="postbox " >
<div class="handlediv"><br /></div><h3 class='hndle'><span>分类目录</span></h3>
<div class="inside">
  <div id="taxonomy-category" class="categorydiv">
	<input type='hidden' name='post_category[]' value='0' />
	<ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
	  <volist name="category" id="vo">
		<li id='category-{$vo.metaid}'>
		  <label class="selectit">
		  <input value="{$vo.metaid}" type="checkbox" name="post_category[]" id="in-category-{$vo.metaid}" />
		  {:str_repeat( '&#8212; ', $vo['level'] )} {$vo.name}</label>
		</li>
	  </volist>
	</ul>
  </div>
</div>
</div>

<div id="tagsdiv-post_tag" class="postbox " >
<div class="handlediv"><br /></div><h3 class='hndle'><span>文章标签</span></h3>
<div class="inside">
<div class="tagsdiv" id="post_tag">
	<div class="jaxtag">
 		<div class="ajaxtag hide-if-no-js">
		<p><input type="text" id="new-tag-post_tag" name="newtag" class="newtag form-input-tip" size="40" autocomplete="off" value="" /></p>
	</div>
	<p class="howto">多个标签请用英文逗号（,）分开</p>
		</div>
		<div class="tagchecklist"></div>
</div>
<p class="hide-if-no-js"><a href="#moretag" class="tagcloud-link" id="link-post_tag">从常用标签中选择</a>
<p id="tagcloud-post_tag" class="the-tagcloud" style="display:none;"><volist name="tag" id="t"> <a href="###" class="tag-link-{$t.metaid}" title="{$t.count} 个话题" style="font-size: 8pt;">{$t.name}</a>&nbsp;</volist></p>
</p>
</div>
</div>

<div id="slugdiv" class="postbox" >
<div class="handlediv"><br /></div><h3 class='hndle'><span>别名</span></h3>
<div class="inside">
<label class="screen-reader-text" for="post_name">别名</label><input name="post_name" type="text" size="40" id="post_name" value="" />
</div>
</div>

<div id="authordiv" class="postbox" >
<div class="handlediv"><br /></div><h3 class='hndle'><span>作者</span></h3>
<div class="inside">
<label class="screen-reader-text" for="post_author_override">作者</label>
<select name='post_author_override' id='post_author_override' class=''>
	<option value='1' selected='selected'>nicholas</option>
</select></div>
</div>

</div></div>

<div id="post-body">
<div id="post-body-content">
<div id="titlediv">
<div id="titlewrap">
	<input type="text" name="post_title" size="30" tabindex="1" value="在此键入标题" onclick="this.value=''" id="title" autocomplete="off" />
</div>
</div>

<div id="postdivrich" class="postarea">

<textarea rows='20' class='theEditor' cols='40' name='content' tabindex='2' id='editor_id' style="width:99.8%;height:350px;visibility:hidden;"></textarea>
<table id="post-status-info" cellspacing="0"><tbody><tr>
	<td id="wp-word-count">字数：<span class="word-count">0</span></td>
	<td class="autosave-info">
	<span class="autosave-message">&nbsp;</span>
	</td>
</tr></tbody></table>

</div>

<div id="normal-sortables" class="meta-box-sortables"><div id="postexcerpt" class="postbox" >
<div class="handlediv"><br /></div><h3 class='hndle'><span>摘要</span></h3>
<div class="inside">
<label class="screen-reader-text" for="excerpt">摘要</label><textarea rows="1" cols="40" name="excerpt" tabindex="6" id="excerpt"></textarea>
<p>摘要是您可以手动添加的内容概要。</p>
</div>
</div>
<div id="trackbacksdiv" class="postbox" >
<div class="handlediv"><br /></div><h3 class='hndle'><span>引用通告</span></h3>
<div class="inside">
<p><input type="text" name="trackback_url" id="trackback_url" class="code" tabindex="7" value="" /><br /> (多个 URL 用空格分隔)</p>
</div>
</div>

<div id="commentstatusdiv" class="postbox" >
<div class="handlediv"><br /></div><h3 class='hndle'><span>讨论</span></h3>
<div class="inside">
<input name="advanced_view" type="hidden" value="1" />
<p class="meta-options">
	<label for="comment_status" class="selectit"><input name="comment_status" type="checkbox" id="comment_status" value="open"  checked='checked' /> 允许评论。</label><br />
	<label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open"  checked='checked' /> 允许被引用。</label>
	</p>
</div>
</div>

<div id="uploaddiv" class="postbox" >
<div class="handlediv"><br /></div><h3 class='hndle'><span>上传附件 <small style="font-weight:normal">(15M)</small></span></h3>
<div class="inside">
<p><input type="file" name="uploadfile" id="uploadfile"></p>
<p id="fileQueue"></p>
<ul id="filelist"></ul>
</div>
</div>

</div>
</div>
</div>
<br class="clear" />
</div><!-- /poststuff -->
</form>
</div>

<link href="__PUBLIC__/admin/js/uploadify/uploadify.css?{$Think.const.VERHASH}" rel="stylesheet" type="text/css" />
<script type='text/javascript' src='__PUBLIC__/js/editor/kindeditor-min.js?{$Think.const.VERHASH}'></script>
<script type='text/javascript' src='__PUBLIC__/js/editor/lang/zh_CN.js?{$Think.const.VERHASH}'></script>
<script type='text/javascript' src='__PUBLIC__/admin/js/tagto.js?{$Think.const.VERHASH}'></script>
<script type='text/javascript' src='__PUBLIC__/admin/js/uploadify/swfobject.js?{$Think.const.VERHASH}'></script>
<script type='text/javascript' src='__PUBLIC__/admin/js/uploadify/jquery.uploadify.v2.1.4.min.js?{$Think.const.VERHASH}'></script>
<script type="text/javascript">
var editor;
KindEditor.ready(function(K) {
	editor = K.create('#editor_id',{
		resizeType:1,
		allowImageUpload : false, 
		allowFlashUpload : false,
		allowMediaUpload : false,
		allowFileUpload : false,
		allowFileManager : false,
		cssPath : ['__PUBLIC__/js/editor/plugins/code/prettify.css'],
		afterChange:function() {
			K('.word-count').html(this.count('text'));
		}
	});
});
	
function insertToEditor( imgurl, atturl, mime, name ) {
	if( mime.replace('image','') != mime ) {
		editor.insertHtml( '<img src="__UPLOAD__'+imgurl+'" />' );
	} else {
		editor.insertHtml( '<span class="download"><a href="'+atturl+'" target="_blank">['+name+']</a></span>' );
	}
}

function deleteAttachment( metaid ) {
	$.post(
		'{:U('Admin/Posts/deleteAttachment')}',
		{'metaid':metaid},
		function(json){
			var result =  $.parseJSON(json);
			if(result.status){
				$('#attach-'+metaid).remove();
			} else {
				alert(result.info);
			}
		}
	);
}

(function($){
  $(document).ready(function(){
  	$('#link-post_tag').toggle(function(){
		$('#tagcloud-post_tag').show();
	},function(){
		$('#tagcloud-post_tag').hide();
	});
	$("#tagcloud-post_tag").tagTo("#new-tag-post_tag");
	$('#uploadfile').uploadify({
		'uploader'       : '__PUBLIC__/admin/js/uploadify/uploadify.swf?' + Math.random(),
		'script'         : '{:U('Admin/Posts/upload')}',
		'cancelImg'      : '__PUBLIC__/admin/js/uploadify/cancel.png',
		'buttonImg'      : '__PUBLIC__/admin/js/uploadify/browse.gif',
        'width'          : 72,
        'height'         : 25,
		'scriptData'	 : {'auth':encodeURIComponent('<php>echo rawurlencode(cookie('auth'));</php>')},
		'multi'          : false,
		'auto'           : true,
		'fileExt'        : '*.doc;*.pdf;*.rar;*.zip;*.gif;*.jpg;*.png;*.tiff;*.bmp',
		'fileDesc'       : '请选择文件',
		'queueID'        : 'fileQueue',
		'sizeLimit'      : 15728640, 
		'onComplete'     : function(event,queueID,fileObj,response,data){
			var result = $.parseJSON(response);
			if(result.status === 0){
				var newChild =  document.createElement("li");
		        newChild.innerHTML = result.info;
		        $('#filelist').append(newChild);   		
			} else {
				$('#filelist').append(result.data);
			}	
		}
	});
  });    
})(jQuery);

</script>
<include file="Public:footer" />